home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / pascal / allfil.zip / GETKEYS.LIB < prev    next >
Text File  |  1986-03-09  |  764b  |  24 lines

  1.   {@@@@@@@@@@@ copyright (C) 1984 by Neil J. Rubenking @@@@@@@@@@@@@@@@@@@@@@@@
  2.   The purchaser of these procedures and functions may include them in COMPILED
  3.   programs freely, but may not sell or give away the source text.
  4.  
  5.   The procedure GetKeys waits for a key to be pressed.  If the key
  6.   was an ordinary one, its value is returned in "choice" and chr(0)
  7.   in "EscChoice".  If the key was a "special" key, chr(27) (= ESC) is
  8.   returned in "choice" and a code in EscChoice.
  9.   The file KEYCHART.DAT gives the codes for the "special" keys.
  10.   }
  11.   PROCEDURE GetKeys(VAR choice, EscChoice : Char);
  12.  
  13.   BEGIN
  14.  
  15.     EscChoice := Chr(0);
  16.  
  17.     REPEAT UNTIL KeyPressed;
  18.  
  19.     Read(Kbd, Choice);
  20.  
  21.     IF KeyPressed THEN Read(Kbd, EscChoice);
  22.  
  23.   END;
  24.